﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace ProjectBase.Core
{
    /// <summary>
    ///     The ID is introduced, as the unique identifier based on the DataStorage.
    ///     This ID property is mostly used for GetById(TID) filtering.
    /// </summary>
    /// <typeparam name = "TID"></typeparam>
    public interface IPersistentObjectWithTypedId<out TID> : IPersistentObject
    {
        /// <summary>
        ///     ID may be of type int, long, decimal, short, Guid etc.
        ///     Setter is protected to allow set this property via reflection in DAO.
        ///     Upper layers should only consume this value via public getter.
        /// </summary>
        TID ID { get; }
    }

    /// <summary>
    ///     IPersistentObject interface is the base description for every entity in the framework
    /// </summary>
    public interface IPersistentObject : IComparable, IComparable<IPersistentObject>, ICloneable
    {
        /// <summary>
        ///     Returns the string representing the 'InvariantCulture' ID value
        /// </summary>
        string IDToDisplay { get; }

        /// <summary>
        ///     This getter returns ToDisplay().
        ///     In some cases is property needed instead of the operation.
        ///     (e.g. ID and Display for ComboBox)
        /// </summary>
        string Display { get; }

        /// <summary>
        ///     Transient objects are not associated with an item already in storage.
        /// </summary>
        bool IsTransient();

        /// <summary>
        ///     String representation of the instance.
        ///     Targeted usage is on UI.
        /// </summary>
        /// <returns></returns>
        string ToDisplay();
    }
}